﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Demo
{
    public class EnginePointlight
    {
        public enum Type
        {
            POINT,
            SPOTLIGHT,
            DIRECT
        };

        protected Vector3 position;
        protected Color diffuse;
        protected float multiplier;
        protected bool shadows;

        public Vector3 Position
        {
            get { return position; }
            set { position = value; }
        }

        public Color Diffuse
        {
            get { return diffuse; }
            set { diffuse = value; }
        }

        public float Intensity
        {
            get { return multiplier; }
            set { multiplier = value; }
        }

        public bool Shadows
        {
            get { return shadows; }
            set { shadows = value; }
        }

        virtual public Texture2D ProjectionTexture
        {
            get { return null; }
            set { }
        }

        virtual public Vector3 Direction
        {
            get { return Vector3.Zero; }
            set { }
        }

    }
    public class EngineDirectlight : EnginePointlight
    {
        Vector3 direction;
        Texture2D projectionTexture;

        override public Vector3 Direction
        {
            get { return direction; }
            set
            {
                if (value == null)
                    direction = Vector3.Zero;
                else if (value.LengthSquared() == 0)
                    direction = Vector3.Zero;
                else
                    direction = Vector3.Normalize(value);
            }
        }

        override public Texture2D ProjectionTexture
        {
            get { return projectionTexture; }
            set { projectionTexture = value; }
        }

    }
    public class EngineSpotlight : EngineDirectlight
    {

    }
}
